/**
 * 根据value查询字典label
 * 单选
 * @param para 
 * @param dict 
 * @returns 
 */
export const handleFilters = (para: string | number | undefined, dict: Array<any>) => {
  let _label = '';
  dict.forEach((item: any) => {
    if (item.value == String(para)) {
      _label = item.label;
    }
  });
  return _label;
};

/**
 * 根据value数组查询字典label
 * 多选
 * @param para 
 * @param dict 
 * @returns 
 */
export const handleFilterMultiple = (para: string, dict: Array<any>) => {
  if(para && para.length){
    var paraList = para.split(',')
    let _label:string[] = [];
    paraList.forEach(item=>{
      dict.forEach(items=>{
        if(item == items.label){
          _label.push(items.label)
        }
      })
    })
    return _label.join(',')
  }else{
    return ''
  }
};
